package passwordCheckerPrimeiraIteracao.testes;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import passwordCheckerPrimeiraIteracao.PasswordCheckerBasePrimeiraIteracao;

@RunWith(Parameterized.class)
public class CheckIfUppercaseAndLowercaseTest
{
	private boolean expectedAnswer;
	private String inputPassword;
	
	public CheckIfUppercaseAndLowercaseTest(String pInputPassword, boolean expectedAnswer)
	{
		this.inputPassword = pInputPassword;
		this.expectedAnswer = expectedAnswer;
	}
	
	@Parameterized.Parameters
	public static Collection UppercaseAndLowercaseData()
	{
		return Arrays.asList(new Object[][]
		{
				{ "luiz", false },
				{ "LUIZ", false },
				{ "luiZ", true },
				{ "LuiZ", true },
				{ "LuIZ", true },
				{ "LUiz", true }
		});
	}
	
	@Test
	public void UppercaseAndLowercaseValidation()
	{
		assertEquals(Boolean.valueOf(expectedAnswer), Boolean.valueOf((PasswordCheckerBasePrimeiraIteracao.checkIfUppercaseAndLowercase(inputPassword))));
	}
}
